NUNIT_FRAMEWORK_DLL=/usr/lib/cli/nunit.framework-2.6/nunit.framework.dll
NUNIT_CONSOLE_EXE=/usr/lib/nunit/nunit-console.exe

all: bin

bin:
	@mkdir -p bin

testbin:
	@mkdir -p bin/PhpVH.Tests/LexicalAnalysis/

test: testbin PhpVHTestsLexicalAnalysisLexerTest
	@result=`${NUNIT_CONSOLE_EXE} -framework:4.0 bin/PhpVH.Tests/LexicalAnalysis/LexerTest.dll`; status=$$?; \
	if [ $$status -eq 0 ]; then \
		echo "$$(tput setaf 2)$$result$$(tput sgr0)"; \
	else \
		echo "$$(tput setaf 1)$$result$$(tput sgr0)"; \
	fi

PhpVHTestsLexicalAnalysisLexerTest:
	mcs PhpVH.Tests/LexicalAnalysis/LexerTest.cs PhpVH/LexicalAnalysis/Lexer.cs -out:bin/PhpVH.Tests/LexicalAnalysis/LexerTest.dll -debug -sdk:4 -target:library -reference:${NUNIT_FRAMEWORK_DLL}

clean:
	@rm -rf bin
	@rm -f TestResult.xml

